#include <stdio.h>

int m[5], cnt, res[5], num[5], C, MIN;
int c[] = {25, 10, 5, 1};

void dfs(int d, int tot)
{
    int i, j, n, temp;
    if (d > 3)
    {
        return;
    }
    else
    {
        for (i = 0; i <= m[d]; i++)
        {
            temp = tot - i * c[d];
            if (temp < 0)
                break;
            else if (temp == 0)
            {
                cnt++;
                for (j = n = 0; j < d; j++)
                    n += num[j];
                if (n + i < MIN)
                {
                    for (j = 0; j < d; j++)
                    {
                        res[j] = num[j];
                    }
                    res[d] = i;
                    for (j = d + 1; j < 4; j++)
                    {
                        res[j] = 0;
                    }
                    MIN = n + i;
                }
                break;
            }
            else
            {
                num[d] = i;
                dfs(d + 1, temp);
            }
        }
    }
}

int main()
{
    while (scanf("%d%d%d%d%d", &m[0], &m[1], &m[2], &m[3], &C), m[0] || m[1] || m[2] || m[3] || C)
    {
        MIN = m[0] + m[1] + m[2] + m[3] + 1;
        cnt = 0;
        dfs(0, C);
        if (cnt == 0)
            printf("Cannot dispense the desired amount.\n");
        else
            printf("Dispense %d quarters, %d dimes, %d nickels, and %d pennies.\n", res[0], res[1], res[2], res[3]);
    }
    return 0;
}